#ifndef _LCD_H
#define _LCD_H

#include "../s3c2440.h"
#include "../type.h"
#include "../my_printf.h"

enum {
    NORMAL = 0,
    INVERT = 1,
};

typedef struct _pins_polarity {
    int de;
    int pwren;
    int vclk;  /* normal:在下降沿获取数据 */
    int rgb;   /* normal:高电平表示1 */
    int hsync; /* normal:高脉冲 */
    int vsync; /* normal:高脉冲 */
} pins_polarity, *p_pins_polarity;

typedef struct _time_sequence {
    int tvp;
    int tvb;
    int tvf;

    int thb;
    int thp;
    int thf;

    int vclk;
} time_sequence, *p_time_sequence;

typedef struct _lcd_params {
    char *name;
    pins_polarity pins_pol;
    time_sequence time_seq;

    int xres;
    int yres;
    int bpp;
    unsigned int fb_base;
} lcd_params, *p_lcd_params;

int register_lcd(p_lcd_params plcd);

int lcd_init(void);

void lcd_enable(void);

void lcd_disable(void);

void get_lcd_params(uint32 *fb_base, int *xres, int *yres, int *bpp);

#endif
